home *** CD-ROM | disk | FTP | other *** search
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!usenet
- From: grantp@usa.pipeline.com(Pete Grant)
- Newsgroups: comp.lang.c++,
- Subject: Re: Passing numbers
- Date: 27 Mar 1996 23:05:30 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4jchjq$i1k@news1.h1.usa.pipeline.com>
- References: <40.88694.1613@channel1.com>
- NNTP-Posting-Host: 38.8.60.7
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete Grant)
- X-Newsreader: Pipeline v3.5.0
-
- On Mar 27, 1996 06:28:00 in article <Passing numbers>,
- 'dspse.bedford@channel1.com (Dspse Bedford)' wrote:
-
-
- >Lets say I have the following class and functions defined:
- >
- >class A{
- >...
- >void func(long lvar);
- >void func(int ivar);
- >....
- >};
- >I know that the compiler can not decide if
- >A a;
- >a.func(30);
- >
- >should match up with the int version of func or the long version of
- >func. However, is there anyway I can tell the compiler which one to
- >use as a default definition such that the above would always be mapped
- >to my default definition. In other words, if an arguement, such as
- >a number, causes an ambiguity use the default definition. Does anyone
- >know how or why not?
- >
-
- Which compiler doesn't distinguish between int and long?
- MSVC++4.1 does.
-
- a.func(30) => func(int);
- a.func(5L) => func(long);
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-